TNEF Stream Syntax

This topic presents a Bakus-Nauer like description of the TNEF stream syntax. In this description, nonterminal elements that have a further definition are in italics. Constants and literal items are in bold. Sequences of elements are listed in order on a single line. For example, the Stream item consists of the constant TNEF_SIGNATURE, followed by a Key, followed by an Object. When an item has more than one possible implementation, the alternatives are listed on consecutive lines. For example, an Object can consist of a Message_Seq, a Message_Seq followed by an Attach_Seq, or just an Attach_Seq.

TNEF_Stream:

TNEF_SIGNATURE Key Object

Key:

a nonzero 16-bit unsigned integer

 

TNEF enabled transports generate this value before using the TNEF implementation to generate a TNEF stream.

Object:

Message_Seq
Message_Seq Attach_Seq
Attach_Seq

Message_Seq:

attTnefVersion
attTnefVersion Msg_Attribute_Seq
attTnefVersion attMessageClass
attTnefVersion attMessageClass Msg_Attribute_Seq
attMessageClass
attMessageClass Msg_Attribute_Seq
Msg_Attribute_Seq

attTnefVersion:

LVL_MESSAGE attTnefVersion sizeof(ULONG) 0x00010000 checksum

attMessageClass:

LVL_MESSAGE attMessageClass msg_class_length msg_class checksum

Msg_Attribute_Seq:

Msg_Attribute
Msg_Attribute Msg_Attribute_Seq

Msg_Attribute:

LVL_MESSAGE attribute-ID attribute-length attribute-data checksum

 

Attribute-ID is one of the TNEF attribute identifiers, such as attSubject. Attribute-length is the length in bytes of the attribute data. Attribute-data is the data associated with the attribute.

Attach_Seq:

attRenddata
attRenddata Att_Attribute_Seq

attRenddata:

LVL_ATTACHMENT attRenddata sizeof(RENDDATA) renddata checksum

 

Renddata is the data associated with the RENDDATA structure containing the rendering information for the corresponding attachment. The RENDDATA structure is defined in the TNEF.H header file.

Att_Attribute_Seq:

Att_Attribute
Att_Attribute Att_Attribute_Seq

Att_Attribute:

LVL_ATTACHMENT attribute-ID attribute-length attribute-data checksum

 

Attribute-ID, attribute-length, and attribute-data have the same meanings as for the Msg_Attribute item.